package edu.sctu.wujiayi.month06.day20150601;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by user11 on 2015/6/1.
 */
public class Code {
    public void codeTest(){
        List<Integer> grade = new ArrayList();
        grade.add(89);
        grade.add(-23);
        grade.add(64);
        grade.add(91);
        grade.add(119);
        grade.add(52);
        grade.add(73);

        for (int i = 0;i<grade.size()-1;i++){
            for (int j = 0;j<grade.size()-1;j++){
                if (grade.get(j)<grade.get(j+1)){
                    grade.add(j,grade.get(j+1));
                    grade.remove(j+2);
                }
            }
        }
        for (int i = 0;i<grade.size();i++){

            if (grade.get(i)>100){

                grade.remove(i);

            }

        }

        System.out.println("考试成绩前三名为：");

        for (int i = 0;i<3;i++){

            System.out.println(grade.get(i));

        }

    }


}
